// HelloWorld.h
#using <mscorlib.dll>
#using "CSharpLogicConector.netmodule"
//Essa biblioteca deve estar no mesmo diretorio desse arquivo, e tbm no mesmo da dll!!

using namespace System;
using namespace System::Runtime::InteropServices;

// This code wraps the C# class using Managed C++

__gc class CSharpLogicConectorC
{
public:
	CSharpLogicConector __gc *logicConector;

	CSharpLogicConectorC() {
		logicConector = CSharpLogicConector::get_Instance();
	}

	void executeMethod(){
		logicConector->executeMethod();
	}

	double getMethodReturnDouble(){
		return logicConector->getMethodReturnDouble();
	}
	
	int getMethodReturnInteger(){
		return logicConector->getMethodReturnInteger();
	}

	char* getMethodReturnString(){
		System::String *resultado = logicConector->getMethodReturnString();
		
		char* str2 = (char*)(void*)Marshal::StringToHGlobalAnsi(resultado);
		char* resultChar = str2;
		
		//Marshal::FreeHGlobal(IntPtr((void*)str2));
		return resultChar;
	}

	void prepareMethodDoubleParameter(double parameter, int position){
		logicConector->prepareMethodDoubleParameter(parameter,position);
	}
	
	void prepareMethodIntegerParameter(int parameter, int position){
		logicConector->prepareMethodIntegerParameter(parameter,position);
	}

	void prepareMethodName(const char* methodName){
		logicConector->prepareMethodName(methodName);
	}

	void prepareMethodClass(const char* methodClass){
		logicConector->prepareMethodClass(methodClass);
	}

	void prepareMethodStringParameter(const char* parameter, int position){
		logicConector->prepareMethodStringParameter(parameter,position);
	}

	void prepareMethodDoubleReturnParameter(){
		logicConector->prepareMethodDoubleReturnParameter();
	}
	
	void prepareMethodIntegerReturnParameter(){
		logicConector->prepareMethodIntegerReturnParameter();
	}

	void prepareMethodStringReturnParameter(){
		logicConector->prepareMethodStringReturnParameter();
	}

	void initializeMethod(){
		logicConector->initializeMethod();
	}
};


